package com.atguigu.day06;

import java.util.Arrays;

public class Test04 {
    public static void main(String[] args) {
        PassParamDemo p1 = new PassParamDemo();
        int q1 = 5;
        System.out.println("num原来是：" + q1);
        p1.doubleNumber(q1);
        System.out.print("调用doubleNumber方法后不变化：");
        System.out.println(q1);
        char q2 = 'A';
        System.out.println("char原来是：" + q2);
        p1.toUpperCase(q2);
        System.out.print("调用toUpperCase方法后不变化：");
        System.out.println(q2);
        Circle c = new Circle();
        double t = 2.0;
        c.radius = 5.0;
        System.out.println("Circle的半径原来是：" + c.radius);
        p1.expandCircle(c, t);
        System.out.print("调用expandCircle方法后变化：");
        System.out.println(c.radius);
        int[] q3 = {5, 6, 7, 8, 1, 3, 4, 6, 9};
        System.out.println("arr原来是：" + Arrays.toString(q3));
        p1.sort(q3);
        System.out.print("调用sort方法后变化：");
        System.out.println(Arrays.toString(q3));
    }
}

class Circle {
    double radius;
}

class PassParamDemo {
    public void doubleNumber(int num) {
        num *= 2;
    }

    public void toUpperCase(char letter) {
        letter -= 32;
    }

    public void expandCircle(Circle c, double times) {
        c.radius *= times;
    }

    public void sort(int[] arr) {
        MyArrays m1 = new MyArrays();
        m1.sort(arr);
    }
}
//q1和q2都是基本数据类型，q3和q4是引用数据类型，在方法的调用中对原来的内容进行了修改